#pragma once

#include "net/defines.h"
namespace libzq
{
	class RegisterImpl
	{
	public:
		virtual bool register_to(const string& self) = 0;
		virtual bool unregister(const string& self) = 0;
	};

	class ZookeeperRegister :
		public RegisterImpl
	{
	public:
		bool register_to(const string& self) override { return false; }
		bool unregister(const string& self) override { return true; };
	};

	class HttpRegister :
		public RegisterImpl
	{
	public:
		void init(const string& url);
		bool register_to(const string& self) override;
		bool unregister(const string& self) override;;

	private:
		bool _register_to(const string& self);
	private:
		string _url;
	};
}